//获取时间函数
function getTime(){
    var date = new Date();
    var year = date.getFullYear();//年
    var mounth = date.getMonth()+1;//月
    var date2 = date.getDate();//日
    var day = date.getDay();//星期
    var hour = date.getHours();//时
    var minutes = date.getMinutes();//分
    var second = date.getSeconds();//秒
    console.log(year+"年"+mounth+"月"+date2+"日"+"星期"+day+""+hour+"时"+minutes+"分"+second+"秒");
    if(hour==9&&minutes==52){
        document.getElementById("clock").innerHTML = "下课啦！！！";
    }else{
        document.getElementById("clock").innerHTML = year+"年"+mounth+"月"+date2+"日"+"星期"+day+" "+hour+"时"+minutes+"分"+second+"秒";
    }
    
}
// setTimeout("getTime()",2000);//定时后执行，单位为毫秒，只会执行一次
setInterval("getTime()",1000);//周期执行